﻿@{
    ViewBag.Title = "查询 RPC 客户端配置";
}
@using YmtRpc.Domain;
@model List<RpcClientconfig>


<form role="form" action="/Config/ClientConfig">
    <div class="form-group">

        <label for="name">服务名称：</label>
        <select class="form-control" style="width:200px" id="appid" name="appid">
            <option value="">全部</option>
            @foreach (string app in ViewBag.AppList)
            {
                if (string.Equals(app, ViewBag.AppId))
                {
                    <option value="@app" selected="selected">@app</option>
                }
                else
                {
                    <option value="@app">@app</option>
                }
            }
        </select>

        <button type="button" class="btn btn-default" onclick="query(); return false;" style="margin-left:10px">查询</button>
    </div>
</form>

<table class="table table-striped table-bordered table-hover">
    <thead>
        <tr>
            <th style="width:50px">序号</th>
            <th>应用编号</th>
            <th>是否启用RPC</th>
            <th>是否总是上传采样数据</th>
            <th>上传采样数据的间隔（分钟）</th>
            <th>获取服务配置间隔（秒）</th>
            <th>Http请求执行的超时时间（毫秒 )</th>
            <th>创建时间</th>
            <th>上次更新时间</th>
        </tr>
    </thead>
    <tbody>
        @if (Model != null)
        {
            int i = 1;
            foreach (RpcClientconfig entity in Model)
            {
                <tr>
                    <td>@(i++)</td>
                    <td>@entity.AppId</td>
                    <td>@entity.EnableUseRpcCall</td>
                    <td>@entity.EnableSendNullData</td>

                    <td>@entity.SendDataDelayMinute</td>
                    <td>@entity.UpdateMetadataDelaySecond</td>
                    <td>@entity.HttpRequestTimeOut</td>
                    <td>@entity.CreateTime</td>
                    <td>@entity.LastUpdateTime</td>
                </tr>
            }
        }
    </tbody>
</table>

<script type="text/javascript">
    function query() {
        
        var href = "/Config/ClientConfig";
        var app = $("#appid")[0].value;

        if (app != "") {
            href = href + "?appId=" + app;
        }

        location.href = href;
        return false;
    }

</script>



